
var count=0;
var s=setInterval(sample,2000);
function sample(btn) {
    document.getElementById('text').innerHTML = count;

    count++;
    if(count%2==0 && !(document.getElementById('btn').clicked)){
        alert('no click');
    }
}
function test() {

    alert('clicked');
    count=0;
}

